<%@ page contentType="text/html; charset=utf-8" language="java" import="java.util.*" pageEncoding="utf-8" errorPage="" %>
<%@ page import="com.club325.voicemicroblog.domain.*" %>
<%@ page import="java.text.*" %>
<%@ page session="false" %>

<%
	//从session里面获取用户id
    HttpSession session = request.getSession();
    
    //判断session是否合法
    if(session == null)
    {
    	//如果session为空，跳转到错误页面
    	response.sendRedirect("/Microblog/pages/timeout.html");
    	return ;
    }
    
    String username = (String)session.getAttribute("username");
    if(username == null)
    {
    	//如果用户名为空
    	response.sendRedirect("/Microblog/pages/timeout.html");
    	return ;
    }
    	
    //获取用户个人信息
    //PrivateInfo thePrivateInfo = theUserControllerImplement.getPrivateInfo(username);
	//if (info == null) {
	//	response.sendRedirect("/Microblog/pages/timeout.html");
    //	return ;
	//}
	
	String name = null;
	String sex = null;
	String birthday = null;
	String address = null;
	String email = null;
	String qq = null;
	String msn = null;
	
	//name = info.getUserID();
	//
	//if (info.getMale()) {
	//	sex = "男";
	//}
	//else {
	//	sex = "女";
	//}
		
	//Date date = info.getBirthday();
	//if (date != null)
	//{
	//	SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
	//	birthday = df.format(date);
	//}
		
	//address = info.getAddress();
	//email = info.getEmail();
	
	//int tempQQ = info.getQQ();
	//if (tempQQ == 0)
	//{
	//	qq = "";
	//}
	//else
	//{
	//	qq = String.valueOf(tempQQ);
	//}
	//msn = info.getMSN();
	
	if (sex == null) { sex = "保密"; }
	if (birthday == null) { birthday = ""; }
	if (address == null) { address = ""; }
	if (email == null) { email = ""; }
	if (qq == null) { qq = ""; }
	if (msn == null) { msn = ""; }
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/frame.dwt.jsp" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Keywords" content="Microblog,Vioce,blog" />
<meta http-equiv="Description" content="Voice Microblog" />

<!-- InstanceBeginEditable name="doctitle" -->
<title>个人信息</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<script src="/Microblog/SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="/Microblog/SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="/Microblog/styles/user_account.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
<link href="/Microblog/styles/global.css" rel="stylesheet" type="text/css" />
<link href="/Microblog/styles/blank.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="main">
<!-- InstanceBeginEditable name="EditRegion_main" -->
  <h1><%= username %>的个人信息...</h1>
  <form id="form_account" name="form_account" method="post" action="/Microblog/ModifyPrivateInfoServlet">
  <table width="600" border="0" cellspacing="10" cellpadding="0">
    <tr>
      <th width="170" scope="row">用户名 :</th>
      <td width="400"><%= username %></td>
    </tr>
    <tr>
      <th scope="row">性别 :</th>
      <td>
        <label class="radio"><input type="radio" name="sex" value="男" id="sex_male" <% if (sex.equals("男")) { %> checked="checked" <% } %>/>男</label>
        <label class="radio"><input type="radio" name="sex" value="女" id="sex_female" <% if (sex.equals("女")) { %> checked="checked" <% } %> />女</label>
      </td>
    </tr>
    <tr>
      <th scope="row">生日(例:2010-10-21) :</th>
      <td><span id="spry_birthday">
        <input type="text" name="birthday" id="birthday" class="middle" value="<%= birthday %>" />
        <span class="textfieldInvalidFormatMsg">格式无效</span></span>
      </td>
    </tr>
    <tr>
      <th scope="row">家庭地址 :</th>
      <td><input type="text" name="address" id="address" class="large" value="<%= address %>" /></td>
    </tr>
    <tr>
      <th scope="row">email :</th>
      <td><span id="spry_email">
        <input type="text" name="email" id="email" class="large" value="<%= email %>" />
        <span class="textfieldInvalidFormatMsg">格式无效</span></span>
      </td>
    </tr>
    <tr>
      <th scope="row">QQ号 :</th>
      <td><span id="spry_qq">
        <input type="text" name="qq" id="qq" class="middle" value="<%= qq %>" />
        <span class="textfieldInvalidFormatMsg">格式无效</span></span>
      </td>
    </tr>
    <tr>
      <th scope="row">MSN帐号 :</th>
      <td><span id="spry_msm">
        <input type="text" name="msn" id="msn" class="large" value="<%= msn %>" />
        <span class="textfieldInvalidFormatMsg">格式无效</span></span>
      </td>
    </tr>
  </table>
    <input type="submit" name="submit" id="submit" value="" />
    <input type="reset" name="reset" id="reset" value="" />
  </form>
  <div id="bottom"></div>
<script type="text/javascript">
<!--
	var spryBirthday = new Spry.Widget.ValidationTextField("spry_birthday", "date", {validateOn:["change"], format:"yyyy-mm-dd", isRequired:false});
	var spryEmail = new Spry.Widget.ValidationTextField("spry_email", "email", {validateOn:["change"], isRequired:false});
	var spryQQ = new Spry.Widget.ValidationTextField("spry_qq", "qq", {validateOn:["change"], isRequired:false});
	var spryMSN = new Spry.Widget.ValidationTextField("spry_msm", "email", {validateOn:["change"], isRequired:false});
//-->
</script>
<!-- InstanceEndEditable -->
</div>
</body>
<!-- InstanceEnd --></html>
